Repository navigation
fix(project): migrate legacy project.json fields and auto-upgrade on save - #599
Open
X-SCI-TECH wants to merge 1 commit into
Open
X-SCI-TECH wants to merge 1 commit into
X-SCI-TECH wants to merge 1 commit into
Conversation
…save - samples: displaySplash/hideLogs/splashText/stableMode -> splashVisible/logsVisible/slug - remove dead stable-mode checkbox and commented scriptConfigs/permissions blocks - always serialize canonical keys so legacy fields are upgraded on save - keep all compatibility aliases for deserialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #598
变更
1. 样例与模板数据
assets-app/sample/布局/**/project.json×3:displaySplash/hideLogs/splashText/stableMode→splashVisible/logsVisible/slug(hideLogs: true→logsVisible: false),并移除已废弃的scripts: {}。2. 失效 UI 与死代码
ProjectConfigActivity中只设主题色的binding.defaultStableMode代码块;activity_project_config.xml中的default_stable_mode复选框;LaunchConfig.kt注释掉的permissions字段块;ProjectConfig.java3 处注释掉的scriptConfigs字段/方法块。3. 保存时自动升级字段
ProjectConfig.toJson(boolean)不再把 canonical key 重命名回源文件的旧 key,直接sGson.toJson(this);logsVisible/splashVisible/slug/build.id等);JsonElement/JsonObjectimport;@SerializedNameCompatible别名与tryReadCrucialData回退解析继续生效,老项目仍可正常打开。非目标
ScriptConfig类本身(ExecutionConfig等仍在用);mOriginalJsonKeys/applyOriginalJsonKeys()在序列化侧已不再使用,可作为后续独立清理(见 issue 建议)。验证
./gradlew :app:assembleDebug:BUILD SUCCESSFUL in 17m 11s(1096 tasks);logsVisible/splashVisible/slug,hideLogs|displaySplash|stableMode|scripts无命中;:app:assembleDebug与打包冒烟。